<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
  <title>筛选</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link href="${server}/static/css/bootstrap.min.css" rel="stylesheet">
  <link href="${server}/static/css/bootstrap_new.css" rel="stylesheet">
 <script type="text/javascript" src="${server}/static/js/jquery.min.js"></script>
 <script type="text/javascript"  src="${server}/static/js/bootstrap.min.js"></script>
  <script type="text/javascript"  src="${server}/static/js/bootstrap_new.js"></script>
   <script type="text/javascript"  src="${server}/static/js/merchandise.js"></script>
  <style>
  .table>thead>tr>th{
  	font-size:6px
  }
  </style>
   <script type="text/javascript">
   $(document).ready(function(){
	   	var skustatus = $('#skuStatu').val();
		 if(skustatus=="")skustatus="-1";
		 $('.navtip').find('li').removeClass("active");
		 $('#'+skustatus+'skuStatu').addClass("active"); 
		 
		 if('${message}' !='' && '${message}' !='null' ){
			 setMessage("alert-warning",'${message}');
		 }
		 
		 
	});
	</script>

</head>
<body data-spy="scroll" data-target=".navbar" data-offset="50">
<%@include file="../common/header.jsp"%>
<input type="hidden" id="server" value="${server}">
<input type="hidden" id="quotationId" value="${quotationId}">
<input type="hidden" id="skuStatu" value="${skuStatu}">
<form action="" id="pagerForm"  method="post">
	<div class="container">
		<ul class="navtip">
			<li><a href="javascript:;" onclick="javascript:window.location.href='${server}/quotationmerchandise/download/${quotationId}';">${quotationName} </a> </li>
			<li class="pull-right" id="2skuStatu"><a href="javascript:;" onclick="getList(2)">已囤货</a></li>
			<li class="pull-right" id="1skuStatu"><a href="javascript:;" onclick="getList(1)">囤货审核中</a></li>
			<li class="pull-right" id="0skuStatu"><a href="javascript:;" onclick="getList(0)">未囤货</a></li>
			<li class="pull-right" id="-1skuStatu"><a href="javascript:;" onclick="getList(-1)">全部</a></li>
		</ul>
		</br> 
		<div id="tableDiv">
			<!-- alert-success alert-info alert-warning alert-danger-->
			<div class="alert alert-dismissable" id="messageDiv"  style="display: none;" >
				   <button type="button" class="close" data-dismiss="alert" 
				      aria-hidden="true">
				      &times;
				   </button>
				 	<span id="message"></span>
			</div>
			<c:if test="${! empty picturePath}">
				<div class="alert alert-info alert-dismissable">
					   <button type="button" class="close" data-dismiss="alert" 
				      aria-hidden="true">
				      &times;
				   </button>
				 	<span id="message">emf格式图片路径：  "${picturePath}"</span>
				</div>
			</c:if>
	<!-- 	<div class="container" style="display: none;">
			<div class="alert alert-success">成功！很好地完成了提交。</div></div> -->
			<table class="table table-bordered table-hover  table-striped" contenteditable="true">
				<thead >
					<tr>
						<th style="min-width :80px">操作</th>
						<th style="min-width :60px">发布状态</th>
						<th style="min-width :60px">囤货状态</th>
						<th style="min-width :50px">article_number</th><!-- 官网货号 -->
						<th style="min-width :50px">name</th>
						<th style="min-width :50px">pic</th>
						<th style="min-width :50px">qty</th>
						<th style="min-width :50px">retail</th>
						<th style="min-width :50px">汇率</th>
						<th style="min-width :100px">欧洲折后价€</th>
						<th style="min-width :100px">欧洲官价¥</th>
						<th style="min-width :100px">国内官价¥</th>
						<th style="min-width :80px">折扣(相比国内官价)</th>
						<th style="min-width :100px">京东价¥</th>
						<th style="min-width :100px">预定价¥</th>
						<th style="min-width :50px">系数1</th>
						<th style="min-width :100px">全款价¥</th>
						<th style="min-width :50px">系数2</th>
						<th style="min-width :100px">参考网址</th>
						<th style="min-width :120px">商品名称</th>
						<th style="min-width :100px">颜色</th>
						<th style="min-width :120px">款式</th>
						<th style="min-width :120px">规格</th>
						<th style="min-width :200px">介绍</th>
						<th style="min-width :120px">备注</th>
						<th style="min-width :100px">成本价¥</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${! empty quotMerchlist}">
					<c:forEach  items="${quotMerchlist}" var="merch" varStatus="status">
							<tr class="merch" >
								<td>
									<span onclick="catchFromInt(this)"><a href="#">爬取</a> </span>
									<span onclick="savemerchandise(this)"><a href="#">保存</a> </span></br>
									<c:if test="${merch.status==2||merch.status==5}">
										<span onclick="pushMerchandise(${merch.rowIndex})"><a href="#">申请发布</a></span></br>
									</c:if>
									<c:if test="${merch.status>=2&&(merch.skuStatus==0||merch.skuStatus==3)}">
										<span onclick="pushStockpiling(${merch.rowIndex})"><a href="#">申请囤货</a></span></br>
									</c:if>
									<c:if test="${merch.status==3||merch.skuStatus==1}">
										<a href="javascript:;" onclick="reviewMerchandiselist()">审核</a></br>
									</c:if>
									<c:if test="${merch.status==4}">
										<a href="javascript:;" onclick="orderlist()">下单</a></br>
									</c:if>	
								</td>
								<td>${statusMap[merch.status]}</td>
								<td>${skuStatusMap[merch.skuStatus]}</br>
									<input name="stockQty" style="width:100%" id="${merch.rowIndex}stockQty" value="${merch.summarySkuQty}">
								</td>
								<td>${merch.articleNumber}</td>
								<td>${merch.name }</td>
								<td><input type="hidden" value="${merch.status}" name="status">
									<c:if test="${! empty merch.picture}"><img src="/excelimg/${merch.picture}" width="100px"></c:if></td>
								<td><input type="hidden" value="${merch.skuStatus}" name="skuStatus">
									${merch.qty}</td>
								<td><input type="hidden" value="${merch.rowIndex}" name="rowindex">
									<input type="hidden" value="${merch.retail}" id="${merch.rowIndex}retail" >${merch.retail}</td>
								<td><input type="text" onchange="validate(this);europePrice(${merch.rowIndex});" value="${merch.rate }" id="${merch.rowIndex}rate" style="width:100%" ></td>
								<td><input type="text" onchange="validate(this);" value="${merch.europePrice }" id="${merch.rowIndex}europePrice" style="width:100%" ></td>
								<td><input type="text" value="${merch.europePriceRmb}" id="${merch.rowIndex}europePriceRmb" disabled="disabled" style="width:100%" ></td>
								<td><input type="text" onchange="validate(this);officePriceChange(${merch.rowIndex})" value="${merch.officePrice }" id="${merch.rowIndex}officePrice" style="width:100%" ></td>
								<td><input type="text" value="${merch.europeOfficeDiscount }" id="${merch.rowIndex}discount" disabled="disabled" style="width:100%" ></td>
								<td><input type="text" onchange="validate(this);" value="${merch.jingdongPrice }" id="${merch.rowIndex}jdprice" style="width:100%" ></td>
								<td><input type="text" onchange="validate(this);skuPriceChange(${merch.rowIndex})" value="${merch.skuPrice }" id="${merch.rowIndex}price" style="width:100%" ></td>
								<td><input type="text" value="${merch.ratio1 }" id="${merch.rowIndex}ratio1" disabled="disabled" style="width:100%" ></td>
								<td><input type="text" value="${merch.discountPrice }" id="${merch.rowIndex}discountPrice" disabled="disabled"style="width:100%" ></td>
								<td><input type="text" value="${merch.ratio2 }" id="${merch.rowIndex}ratio2" disabled="disabled"  style="width:100%" ></td>
								<td><input type="text" value="${merch.referenceInternetUrl }" id="${merch.rowIndex}url" style="width:100%" ></td>
								<td><input type="text" value="${merch.merchandiseName }" id="${merch.rowIndex}name" style="width:100%" ></td>
								<td><input type="text" value="${merch.merchandiseColor }" id="${merch.rowIndex}color" style="width:100%" ></td>
								<td><input type="text" value="${merch.merchandiseCollection }" id="${merch.rowIndex}collection" style="width:100%" ></td>
								<td><input type="text" value="${merch.merchandiseSpecDesc }" id="${merch.rowIndex}spec" style="width:100%" ></td>
								<td><input type="text" value="${merch.merchandiseDesc }" id="${merch.rowIndex}desc" style="width:100%" ></td>
								<td><input type="text" value="${merch.remark }" id="${merch.rowIndex}remark" style="width:100%" ></td>
								<td></td>
							</tr>
					</c:forEach>
					</c:if>
					
				</tbody>
			</table>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="button" onclick="quotationTrate();" class="btn  btn-primary" contenteditable="true">筛选完成</button>
				</div>
			</div>

		</div>
	</div>
</form>


</body>
</html>
